#include "board.h"
#include "rtthread.h"


static void Swtmr1_Callback(void* parameter);
static void Swtmr2_Callback(void* parameter);

static rt_timer_t swtmr1 = RT_NULL;
static rt_timer_t swtmr2 = RT_NULL;

static uint32_t tmrCb_count1 = 0;
static uint32_t tmrCb_count2 = 0;


int main(void)
{	
		ILI9341_GramScan ( 6 );//设置显示模式
		LED_Color(LED_OFF);
	
		swtmr1 = rt_timer_create("Swtmr1_Callback",Swtmr1_Callback,0,5000,RT_TIMER_FLAG_ONE_SHOT | RT_TIMER_FLAG_SOFT_TIMER);
		rt_timer_start(swtmr1);
	  swtmr2 = rt_timer_create("Swtmr2_Callback",Swtmr2_Callback,0,1000,RT_TIMER_FLAG_PERIODIC | RT_TIMER_FLAG_SOFT_TIMER);
		rt_timer_start(swtmr2);
}

static void Swtmr1_Callback(void* parameter)
{
	uint32_t tick_num1;
	
	tick_num1 = (uint32_t)rt_tick_get();
	
	tmrCb_count1++;
	rt_kprintf("Swtmr1_callback:%d \n", tmrCb_count1);
	rt_kprintf("tick_num1 =%d\n", tick_num1);
}

static void Swtmr2_Callback(void* parameter)
{
	uint32_t tick_num2;
	
	tick_num2 = (uint32_t)rt_tick_get();
	tmrCb_count2++;
	
	rt_kprintf("Swtmr2_callback:%d \n", tmrCb_count2);
	rt_kprintf("tick_num2 =%d\n", tick_num2);
}